<?php

require_once("model/route.class.php");


class routeCollection {

	private $destA;
	private $destB;

	private $routes = array(); // array med route
	
	public function __construct($destA, $destB){
		$this->destA = $destA;
		$this->destB = $destB;
	}
	
	public function getDestA(){ return $this->destA; }
	public function getDestB(){ return $this->destB; }
	public function getName() { return $this->destA.' - '.$this->destB; }
	public function getAllRoutes(){ return $this->routes; }
	public function getRoute($i){ return $this->routes[$i]; }
	
	public function setDestA($dest){ $this->destA = $dest; }
	public function setDestB($dest){ $this->destB = $dest; }
	public function setAllRoutes($array){ $this->routes = $array; }
	public function addRoute($route){ $this->routes[] = $route; }
	
	public function getSize(){ return count($this->routes); }
	
	public function reverse(){
		$tmp = $this->destA;
		$this->destA = $this->destB;
		$this->destB = $tmp;
		foreach($this->routes as $route){
			$route->setReversedOrder();
		}
	} 

}
?>